package com.jh.rq;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * @author Li
 * @Date 2023/4/17 9:18
 */
public class DateDemo1 {
    public static void main(String[] args) throws ParseException {
        Date date = new Date(0L);
        System.out.println(date);
        SimpleDateFormat date1 = new SimpleDateFormat("yyyy年MM月dd日 HH:mm:ss");
        String format = date1.format(new Date());//日期转字符串
        System.out.println(format);



        Date date2 = date1.parse(format);//字符串转日期
        System.out.println(date2);
    }
}
